/** Copyright 2014, Ross Mahony. Some rights reserved. See COPYING. */
package controllers

import play.api._
import play.api.mvc._

/** [[play.api.mvc.Controller]] for the home page of the application. */
object Application extends Controller {

 /** Action to view the home page. */
  def index = Action {
    Ok(views.html.index())
  }

  /** Javacript routing action. */
  def javascriptRoutes = Action { implicit request =>
    import routes.javascript._
    Ok(
      Routes.javascriptRouter("jsRoutes")(
        EnergyUsages.fetch,
        Tips.like,
        Tips.comment,
        Tips.delete,
        Tips.deleteComment
      )
    ).as("text/javascript")
  }
}